if (!global.ShadowMamba) {
global.ShadowMamba = {};
        }
var sm = global.ShadowMamba;

function sm_on_key(k) {
if (k.k != k.key || k.m != k.mod) {
return; // it's not the key combination we are supposed to respond to.
}
var key = k.k;
var mod = k.m;

/*
if (key == i_key && mod == shift_mod) {
if (shared.Map.ScriptFlags.get("important_units")) {
var Units = shared.Map.ScriptFlags.get("important_units");
Units = Units.split(",");
for (var i = 0; i < Units.length; i++) {
shared.Map.MoveReview(Units[i]);
}
}
}*/
/* if (key == b_key && mod == shift_mod) {
if (map.ScriptFlags.get("boss_units")) {

}*/
}

function sm_after_map_load(l) {
var map = l.map;
var flags = map.ScriptFlags;
}

function sm_before_turn(b) {
var units = b.starting_units;
var x = 0
if (units.length == 0) return;
while (x < units.length) {
var v = 0;
if (units[x].Effects.length > 0) {
while (v < units[x].Effects.length) {
var p = units[x].Effects[v];
if (p.ScriptFlags.get("start_turn_sound")) {
randomSound(p.ScriptFlags.get("start_turn_sound"));
}
v++
}
}
x++;
}
}

function sm_after_turn(a) {
var units = a.ending_units;
var x = 0
if(units.length == 0) return;
while (x < units.length) {
var v = 0;
if (units[x].Effects.length > 0) {
while (v < units[x].Effects.length) {
var p = units[x].Effects[v];
if (p.ScriptFlags.get("end_turn_sound")) {
randomSound(p.ScriptFlags.get("end_turn_sound"));
}
v++
}
}
x++;
}
}

